package top.kaoshanji.p1ch06b;

import java.util.Arrays;
import java.util.Random;

/**
 * 代码清单-p1ch06b-130页a：创建一个非基本类型的对象数组
 * author kaoshanji
 * ^_^
 * create time 2025/3/8 18:29
 */
public class ArrayClassObj {

    public static void main(String[] args) {
        Random rand = new Random(47);
        Integer[] a = new Integer[rand.nextInt(20)];
        System.out.println("length of a = " + a.length);

        for (int i = 0; i < a.length; i++) {
            a[i] = rand.nextInt(500); // 自动装箱
        }

        System.out.println(Arrays.toString(a));

    }


}
